package com.qk.management.web.config;

import com.qk.management.web.Interceptor.LoginCheckInterceptor;
import com.qk.management.web.Interceptor.MyInterceptor;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@SuppressWarnings("all")
public class WebConfig implements WebMvcConfigurer {
//    @Autowired
//    private MyInterceptor myInterceptor;
    @Autowired
    private LoginCheckInterceptor loginCheckInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginCheckInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/login");
//       registry.addInterceptor(myInterceptor)
//               .addPathPatterns("/**")
//               .excludePathPatterns("/login");
    }
}
